package cn.iocoder.yudao.module.wine.dal.mysql.businessuserlog;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wine.dal.dataobject.businessuserlog.BusinessUserLogDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.businessuserlog.vo.*;

/**
 * 商家认证日志 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface BusinessUserLogMapper extends BaseMapperX<BusinessUserLogDO> {

    default PageResult<BusinessUserLogDO> selectPage(BusinessUserLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BusinessUserLogDO>()
                .eqIfPresent(BusinessUserLogDO::getUserId, reqVO.getUserId())
                .eqIfPresent(BusinessUserLogDO::getBeforeStatus, reqVO.getBeforeStatus())
                .eqIfPresent(BusinessUserLogDO::getAfterStatus, reqVO.getAfterStatus())
                .eqIfPresent(BusinessUserLogDO::getOperateType, reqVO.getOperateType())
                .eqIfPresent(BusinessUserLogDO::getContent, reqVO.getContent())
                .betweenIfPresent(BusinessUserLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BusinessUserLogDO::getId));
    }

}